fix(which): copri la Giunta per le autorizzazioni, togli il mis-route su immunità#81
Merged
Merged
Conversation
… su immunità (#78) Il term "parlamentare" nudo su `search find` catturava query di tutt'altro tema — "immunità parlamentare", "gruppo parlamentare" — perché lo scorer assegna 60 quando la query contiene il term. Diventa "cerca parlamentare": chi cerca "parlamentare" da solo trova ancora il comando, chi cerca altro no. Aggiunti a `committees list` e `committee-members list` i termini su giunta, autorizzazione a procedere, immunità e insindacabilità: il tema era scoperto pur essendo pienamente servito da quei due comandi. Closes #78 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves the which command’s capability routing by removing an overly-generic term that caused false positives, and by expanding committee-related capabilities to cover “Giunta per le autorizzazioni”/immunità-related queries.
Changes:
- Adjusted
search findterms to avoid mis-routing queries that merely contain “parlamentare”. - Added giunta/autorizzazioni/immunità/insindacabilità terms to
committees listandcommittee-members list, aligning descriptions to “Commissioni e giunte”. - Added targeted tests to cover the new routing behavior and prevent regressions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/core/capabilities.ts | Updates the which capability index terms/descriptions to fix mis-routing and cover giunta/immunità queries. |
| src/core/capabilities.test.ts | Adds regression tests ensuring “immunità parlamentare” no longer routes to search find and giunta-related queries are covered. |
|
| Filename | Overview |
|---|---|
| src/core/capabilities.ts | Updates routing terms and descriptions, but the replacement committee phrase creates an equal-score false positive for the supported parlamentare query. |
| src/core/capabilities.test.ts | Adds focused routing tests, though the person-search regression assertion permits the newly introduced committee result. |
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
src/core/capabilities.ts:44
**Parlamentare triggers committee routing**
When a user runs `which "parlamentare"`, the new `giunta parlamentare` term receives 70 points because it contains the query, causing `committees list` to appear at the same score as the intended `search find` command. The non-regression test only checks that `search find` is present, so it permits this incorrect extra result.
Reviews (2): Last reviewed commit: "fix(which): "giunta parlamentare" invece..." | Re-trigger Greptile
Da review PR #81: il term nudo ricreava lo stesso difetto che questa PR rimuove per "parlamentare" — "giunta regionale" o "delibera di giunta" avrebbero pescato un comando che copre solo il Parlamento. Chi cerca "giunta" da solo trova ancora committees; le giunte locali no. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #78
Il problema
Due sintomi, una sola area:
which "giunta per le autorizzazioni"ewhich "autorizzazione a procedere"→ nessun comando, pur essendo il tema pienamente servito dacommittees list+committee-members list(la Giunta èo19_3520, 137 sedute in leg. 19).which "immunità parlamentare"→search find, cioè "cerca un parlamentare per nome". Un match sbagliato è peggio di nessun match per chi si fida dell'output.La causa del mis-route
search findaveva tra i termini"parlamentare", nudo. Lo scorer assegna 60 punti quando la query contiene il termine (q.includes(t)), quindi qualunque domanda con quella parola dentro finiva lì: "immunità parlamentare", ma anche "gruppo parlamentare".Cosa fa questa PR
"parlamentare"→"cerca parlamentare"susearch find. Chi cerca "parlamentare" da solo continua a trovarlo (match parziale sul termine più lungo); chi cerca altro non lo pesca più.committees listecommittee-members list, con ledescallineate ("Commissioni e giunte").Non ho toccato lo scorer. Irrigidirlo (match su parola intera, soglia sulla lunghezza del termine) avrebbe cambiato il punteggio di tutte e 33 le voci per curare un termine mal scelto: più rischio di regressioni che guadagni. Se emergono altri falsi positivi dello stesso tipo, allora il problema è lo scorer e si affronta lì.
Verifica
+4 test in
capabilities.test.ts(copertura dei tre temi, assenza disearch finddove non c'entra, non-regressione su "cerca"/"nome"/"parlamentare"/"trova persona"). Suite completa verde: 210 test.🤖 Generated with Claude Code